package com.clever.mall.service;

import com.clever.mall.commons.dto.ShoppingCartDto;
import com.clever.mall.vo.ShoppingCartVo;

import java.util.List;

public interface ShoppingCartService {

    /**
     * 通过用户id查询所有购物车内容
     * @param uid
     * @return
     */
    List<ShoppingCartVo> selectShoppingCartAll(int uid);

    /**
     * 分页查询,第一页为 1
     * @param uid
     * @param page  第几页
     * @param size  单页数量
     * @return
     */
    List<ShoppingCartVo> selectShoppingCartByLimit(int uid, int page, Integer size);

    /**
     * 将商品加入购物车
     * @param shoppingCartDto
     * @return
     */
    int insertShoppingCart (ShoppingCartDto shoppingCartDto);

    /**
     * 通过用户id和产品id删除购物车内容
     * @param uid
     * @param pid
     * @return
     */
    int deleteShoppingCart(int uid, int pid);

    /**
     * 批量删除
     * @param shoppingCartDtoList
     * @return
     */
    int deleteShoppingCartList(List<ShoppingCartDto> shoppingCartDtoList);

}
